Online documentation - WebsydianExpress v3.5 |
WSYEXTJS/ExtEventHandler
Note that this abstract function is placed in the WSYEXTJS model.
This is the basic EventHandler you should use when developing Ext JS applications for WebsydianExpress.
The EventHandler inherits from EventHandlerForProcess. The functionality of the ExtEventHandler and the way you modify it's behavior is exactly the same as for the standard EventHandlerForProcess.
The EventHandler scopes a number of source code objects that is used for optimizing the new template generation used by the Ext JS framework for WebsydianExpress. These source codes are only used when generating the template - not when the EventHandler is executed.
The way you use this EventHandler is exactly the same as any other EventHandler in WebsydianExpress. As for all EventHandlers, you must always end by calling a PageGenerator.
The difference is that when you inherit from this abstract function, you get a number of source codes that can be used to control the new template generation used by the Ext JS framework for WebsydianExpress. The following section describes how these source codes are used by the default template generation provided as part of WebsydianExpress. Note if you change the meta templates used by the template generation, you can remove or change this behavior.
This determines the text shown on the button that corresponds to the EventHandler.
If you don't specify a value in this source code, the default will be the unscoped Plex name of the EventHandler function.
Any specified text is added as a property named wsybuttontext to the config object of the event.
Default: true
This option is used by events with the following event types: wsyextpopupevent, wsyextstandardevent.
When the value is true, any client validation you might have defined for all the fields in the form will be executed when the button is pressed.
Alternative value: false.
The value is added as a property named wsyclientvalidation to the config object of the event.
Example: Set the value to false for a cancel button on an update or insert page - no client validation should be performed.
Note that this does not define any client validation.
Validation defined in Plex doesn't create any client validation definitions for the fields.
Note that all fields on the page that has client validation defined will be validated - not just the ones defined in webinput of the EventHandler. This is due to the fact that all buttons in an Ext JS WebsydianExpress page shares one form.
Default: wsyextstandardevent
Technically, this determines the set of meta templates used when creating the templates. Functionally, this determines how the page generated by the PageGenerator called by the EventHandler should be presented.
The default template generation supports the following values:
You can define your own set of values - but only after creating the necessary meta templates to support the template generation of these types.
Generally, if you haven't defined your own event types, just leave this value as it is.
This refers to an icon class in a CSS file. This CSS file must be available for the application when the page containing the event is loaded.
Any specified text is added as a property named wsyiconcls to the config object of the event.
Example: If you want to use the standard cancel button used in the delivered examples, specify: wsyicon-cancel. This class is defined in the wsy-ext.css file that is delivered as part of the WebsydianExpress installation so it is available for the application. If you create your own classes, you must define your own css file, deploy it as a ressource on the web server and make it available for the application (typically by adding a reference to the css in the WSFRMPG.htm page used by the site).
Default: wsyload
This defines the action to take when the http response to the request generated by the event returns successfully.
The default actions are:
Any specified text is added as a property named wsyonsuccess to the config object of the event.
Examples:
Default: {}
The wsyproperties source code allows you to define any set of property names / values for the config object of the event.
You must specify a valid json object in the source code - including the curly brackets.
Note that the properties you define here are applied after the config object initially is created. This means that any properties you define here will override their default values - or the values defined in the other source codes scoped by the EventHandler.
You can use this source code to specify a text that will be shown as tooltip for the button.
Any specified text is added as a property named wsytooltip to the config object of the event.
We recommend that you only inherit from ExtEventHandler for EventHandlers you include/comprise on PageGenerators that inherit from ExtPageGenerator. We also recommend that all EventHandlers on these pages inherits from ExtEventHandler.
As described above, you can specify the value wsyextpopupevent for the wsyeventtype source code. You can get the same effect by inheriting from ExtEventHandlerPopUp. We recommend that you inherit from ExtEventHandlerPopUp to clearly indicate that the event will open a pop-up window.
Events inheriting from ExtEventHandler will occur as detail events - if you want a grid event you should inherit from ExtGridEventHandler instead.